import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class InputWheel {
    final static int CHAR_NUMBER = 27;//26个字母和一个空格
    List<Character> link;

    public InputWheel() {
        Character[] str = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ' '};
        link = new ArrayList<Character>();
        Collections.addAll(link, str);
    }

    int inputChar(Character ch) {
        int num = -1;//默认为错误输出
        for (int i = 0; i < CHAR_NUMBER; i++) {
            if (ch.equals(link.get(i))) {
                num = i;
                break;
            }
        }
        return num;
    }

    Character inputNum(int num) {
        Character ch = '?';//默认为错误输出
        ch = link.get(num % CHAR_NUMBER);
        return ch;
    }
}